Skip to content

fix(nanodump): make host-tool build work on macOS#145

Closed
slimwang wants to merge 1 commit into
Adaptix-Framework:mainfrom
slimwang:fix/macos-nanodump-host-build
Closed

fix(nanodump): make host-tool build work on macOS#145
slimwang wants to merge 1 commit into
Adaptix-Framework:mainfrom
slimwang:fix/macos-nanodump-host-build

Conversation

@slimwang

@slimwang slimwang commented Jun 12, 2026

Copy link
Copy Markdown

Problem

Building Creds-BOF on macOS fails in the nanodump Makefile:

ld: warning: -s is obsolete
ld: library 'crt0.o' not found
clang: error: linker command failed with exit code 1

and then:

x86_64-w64-mingw32-strip: scripts/restore_signature: file format not recognized

The cross-compiled BOF artifacts (mingw .o/.exe/.dll) build fine. The failures are only in the host-compiled helper tools (bin2c, restore_signature):

  • On macOS gcc is Apple clang, which does not support -static (there is no crt0.o / static libc) nor the obsolete -s linker flag.
  • restore_signature is then stripped with the mingw strip, which only understands Windows PE — not the native Mach-O binary.

Fix

Detect the host OS in Creds-BOF/nanodump/Makefile:

  • Drop -static -s from the host gcc invocations on Darwin.
  • Use the host strip (not the mingw strip) for the native restore_signature helper.

Linux behavior is unchanged (-static -s and mingw strip are kept).

On macOS, gcc is Apple clang which does not support static linking
(no crt0.o/static libc) or the obsolete -s linker flag, so building
the host helper tools (bin2c, restore_signature) failed with
"library 'crt0.o' not found". Stripping restore_signature with the
mingw strip also failed since it is a native Mach-O binary, not PE.

Detect the host OS and drop -static -s on Darwin, and use the host
strip instead of the mingw strip for the native helper tool. Linux
behavior is unchanged.
@slimwang

Copy link
Copy Markdown
Author

Closing as duplicate. This is already addressed by #139 (the more complete cross-platform fix, with CI, closes #129) and #144 (same minimal Makefile fix, opened earlier). No need for a third PR on the same lines.

@slimwang slimwang closed this Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant